<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link rel="shortcut icon" href="favicon.ico">

	<title>H+</title>
	<meta name="keywords" content="H+">
	<meta name="description" content="H+">

	<link href="__CSS__/bootstrap.min.css" rel="stylesheet">
	<link href="__CSS__/font-awesome.min.css" rel="stylesheet">
	<link href="__CSS__/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
	<link href="__CSS__/animate.min.css" rel="stylesheet">
	<link href="__CSS__/style.min.css" rel="stylesheet">
	<link href="__CSS__/plugins/sweetalert/sweetalert.css" rel="stylesheet">
	<!-- <link rel="stylesheet" href="__STATIC__/zui/lib/chosen/chosen.css"> -->
    <link rel="stylesheet" href="__STATIC__/select2/select2.css" type="text/css" cache="false"/>
    <!-- <link rel="stylesheet" href="__STATIC__/select2/theme.css" type="text/css" cache="false"/> -->
</head>
<body class="gray-bg">
	<div class="wrapper wrapper-content animated fadeInRight">
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-title">
						<h5>
							{$table.title??'无标题'}
							<small>{$table.suggest??'无副标题'}</small>
						</h5>
						<div class="ibox-tools">
							<a class="collapse-link">
								<i class="fa fa-chevron-up"></i>
							</a>
							<a class="dropdown-toggle" data-toggle="dropdown" href="#">
								<i class="fa fa-wrench"></i>
							</a>
							<ul class="dropdown-menu dropdown-user">
								{volist name="buttonList" id="item"}
									<li><a href="{:url($item['href'])}">{$item.title}</a></li>
								{/volist}
							</ul>
							<a class="close-link">
								<i class="fa fa-times"></i>
							</a>
						</div>
					</div>
					<div class="ibox-content">
						<div class="row">
							<div class="filter-wrap" style="display: none;">
								<div class="filter">
									<div class="filter-title" style="border-bottom: 1px solid #ddd; text-align: center;">
										<h2>{$table.search_title??'搜索'}</h2>
									</div>
									<div class="filter-content">
										<form method="post" class="form-dont-clear-url-param" id="searchForm">
											{notempty name="searches"}
												{volist name="searches" id="search"}
													<div class="form-group" style="margin-top: 20px;">
														{switch $search.type}
														    {case select}
															    <select name="{$search.name}" class="form-control filter">
																	<option value="">请选择{$search.title}</option>
																	{volist name="search.options" id="value"}
																		<option value="{$key}">{$value}</option>
																	{/volist}
																</select>
															{/case}
															{case select2}
	              												<select name="{$search.name}[]" id="{$search.name}" class="select2 filter" style="width: 100%;" multiple="multiple" placeholder="请选择{$search.title}">
																	{volist name="search.options" id="value"}
																		<option value="{$key}">{$value}</option>
																	{/volist}
																</select>
															{/case}
															{case time}
																<input type="text" name="{$search.name}_start" onclick="laydate({if false}{istime: true}{/if});" class="form-control layer-date filter" id="search_{$search.name}_start" placeholder="请选择开始{$search.title}" style="margin-bottom: 5px;">
																<input type="text" name="{$search.name}_end" onclick="laydate({if false}{istime: true}{/if});" class="form-control layer-date filter" id="search_{$search.name}_end" placeholder="请选择结束{$search.title}">
																<input type="hidden" name="time[]" value="{$search.name}" class="filter">
															{/case}
															{default/}
																<input type="text" name="{$search.name}" class="form-control filter" id="search_{$search.name}" placeholder="请输入{$search.title}">
														{/switch}
														{present name="search.extend.like"}
															<input type="hidden" name="like[]" value="{$search.name}" class="filter">
														{/present}
														{present name="search.extend.in"}
															<input type="hidden" name="in[]" value="{$search.name}" class="filter">
														{/present}
													</div>
												{/volist}
												{if $param = request()->param()}
													{volist name="param" id="vo"}
														<input type="hidden" name="{$key}" value="{$vo}" class="filter" />
													{/volist}
												{/if}
												<div class="form-group" style="margin-top: 20px; text-align: center;">
													<input type="button" class="btn btn-success btn-search" value="{:lang("search")}"/>
												</div>
											{else}
												<div style="width: 100%; text-align: center; margin-top: 40px; margin-bottom: 40px;">没有搜索</div>
											{/notempty}
										</form>
									</div>
								</div>
							</div>
							<div class="main-wrap" style="border-left: 1px solid #ddd;">
								<div class="main">
									<table id="cusTable" 
										data-toggle='table'
										data-url='<?php echo url(isset($table['url']) ? $table['url'] : '');?>'
										data-height='{$table.height??'700'}'
										data-show-header='{$table.show_header??'true'}'
										data-show-footer='{$table.show_footer??'false'}'
										data-buttons-align='{$table.buttons_align??'right'}'
										data-show-refresh='{$table.show_refresh??'true'}'
										data-show-toggle='{$table.show_toggle??'true'}'
										data-show-pagination-switch='{$table.show_pagination_switch??'true'}'
										data-show-export='true'
										data-show-columns='{$table.show_columns??'true'}'
										data-pagination='{$table.pagination??'true'}'
										data-pagination-loop='{$table.pagination_loop??'true'}'
										data-page-number='{$table.page_number??'1'}'
										data-page-size='{$table.page_size??'20'}'
										data-page-list='{$table.page_list??'[10,20,50,100,200]'}'
										data-only-info-pagination='{$table.only_info_pagination??'false'}'
										data-side-pagination='{$table.side_pagination??'server'}'
										data-pagination-h-align='{$table.pagination_h_align??'right'}'
										data-pagination-v-align='{$table.pagination_v_align??'bottom'}'
										data-pagination-detail-h-align='{$table.pagination_detail_h_align??'left'}'
										data-pagination-pre-text='{$table.pagination_pre_text??'&lsaquo;'}'
										data-pagination-next-text='{$table.pagination_next_text??'&rsaquo;'}'
										data-card-view='{$table.card_view??'false'}'
										data-detail-view='{$table.detail_view??'true'}'

										data-striped='{$table.striped??'true'}'
										data-search='{$table.search??'true'}'
										data-search-align='{$table.search_align??'right'}'
										data-search-on-enter-key='{$table.search_on_enter_key??'true'}'
										data-strict-search='{$table.strict_search??'false'}'
										data-search-text='{$table.search_text??''}'
										data-advanced-search="true"
										data-id-table="advancedTable"

										data-query-params-type='{$table.query_params_type??'undefined'}'
										data-export-data-type='all'
										data-export-types="['json', 'xml', 'csv', 'txt', 'sql', 'excel', 'doc']"
										data-export-options='{}'

										data-show-filter='{$table.show_filter??'true'}'

										data-query-params='queryParams'
										>
										<thead>
											<th data-checkbox='true'></th>
											{volist name='keyList' id='vo'}
												<th
													data-field="{$vo.name}"
													data-title='{$vo.title??$vo.name}'
													data-title-tooltip='{$vo.description??$vo.title}'

													data-searchable='true'
													data-search-formatter='true'
													>{$vo.title??$vo.name}</th>
											{/volist}
										</thead>
									</table>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

	<script src="__JS__/jquery.min.js"></script>
	<script src="__JS__/bootstrap.min.js"></script>
	<script src="__JS__/content.min.js"></script>

	<script src="__JS__/plugins/bootstrap-table/bootstrap-table.js"></script>
	<script src="__JS__/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>

	<script src="__JS__/plugins/bootstrap-table/extensions/toolbar/bootstrap-table-search.js"></script>
	<script src="__JS__/plugins/bootstrap-table/extensions/toolbar/bootstrap-table-button.js"></script>
	<!-- // <script src="__JS__/plugins/bootstrap-table/extensions/toolbar/bootstrap-table-toolbar.js"></script> -->
	<!-- // <script src="__JS__/plugins/bootstrap-table/extensions/multiple-search/bootstrap-table-multiple-search.js"></script> -->
	<script src="__JS__/plugins/bootstrap-table-export/bootstrap-table-export.js"></script>
	<script src="__JS__/plugins/bootstrap-table-export/tableExport.min.js"></script>
	<!--<script src="__JS__/plugins/bootstrap-table-export/jspdf.min.js"></script>
	<script src="__JS__/plugins/bootstrap-table-export/jspdf.plugin.autotable.js"></script>
	<script src="__JS__/plugins/bootstrap-table-export/html2canvas.min.js"></script>-->

	<!-- // <script src="__STATIC__/zui/lib/chosen/chosen.js"></script> -->
	<script src="__STATIC__/select2/select2.min.js" cache="false"></script>
	<script src="__JS__/plugins/suggest/bootstrap-suggest.min.js"></script>
	<script src="__JS__/plugins/layer/laydate/laydate.js"></script>
	<script src="__JS__/plugins/sweetalert/sweetalert.min.js"></script>
	<script src="__JS__/plugins/layer/layer.min.js"></script>

	<script type="text/javascript">
		$(function(){
			$(".search").hide();
			$('.select2').select2();
			// var leftButtons = {};
		})
		function queryParams(params) {
			var param = {}, filterColumns = {}, searches = $("#searchForm").find('.filter');

			searches.each(function(){
				var text = $.trim($(this).val());
				var $field = $(this)[0].name;

				if ( text ) {
					filterColumns[$field] = text;
				} else {
					delete filterColumns[$field];
				}
			});

			if ( params.filter ) {
				var filter = JSON.parse(params.filter);
				$.extend(filter, filterColumns);
				param.filter = JSON.stringify(filter);
			} else {
				param.filter = JSON.stringify(filterColumns);
			}

			return $.extend(params, param);
		}
	</script>
</body>
</html>